<?php if(!defined('EMLOG_ROOT')) {exit('error!');}?>
<?php if($pageurl) { ?>
<div class="ui-bar ui-bar-c arrayBtn" data-position="inline" >
<div id="pagenavi">
<?php echo $pageurl;?>
</div>
</div>
<?php } ?>
<?php if(ISLOGIN === true): ?>
<div data-role="content">
<form method="post" action="./index.php?action=t" enctype="multipart/form-data">
<textarea cols="20" rows="3" name="t"></textarea><br />
<input type="file" name="img" /><br />
<input type="submit" value="发布" />
</form>
</div>
<?php endif;?>

<div data-role="content" class="contentDiv">
<?php 
$i= $twnum - ($page - 1)*Option::get('index_twnum');
foreach($tws as $value):
$img = empty($value['img']) ? "" : '<a title="查看图片" href="'.BLOG_URL.str_replace('thum-', '', $value['img']).'" target="_blank"><img style="border: 1px solid #EFEFEF;" src="'.BLOG_URL.$value['img'].'"/></a>';
$by = $value['author'] != 1 ? 'by:'.$user_cache[$value['author']]['name'] : '';
$avatar = empty($user_cache[$value['author']]['avatar']) ? 
                BLOG_URL . 'admin/views/images/avatar.jpg' : 
                BLOG_URL . $user_cache[$value['author']]['avatar'];
$author = $user_cache[$value['author']]['name'];
?>
<div class="user" >
        		<span class="userFloor">
            	<em>#<?php echo $i; ?></em>
                </span>
            	<span class="userAvatar">
				<img src="<?php echo $avatar; ?>">
				</span>
<span class="userName">
<a href="/wap"  data-transition="none"><?php echo $author; ?></a>
 </span>
<br/>
<span class="userBtn">
<a><?php echo $value['date'];?></a>
<?php if(ISLOGIN === true && $value['author'] == UID || ROLE == 'admin'): ?>
 <a href="./?action=delt&id=<?php echo $value['id'];?>" data-transition="none">删除</a>
<?php endif;?>
</span>
</div>
 <div class="pbody">
	<div id="postmessage" class="postmessage">
	<?php echo $value['content'];?><br /><?php echo $img;?>
	</div>
</div>
<?php $i--;endforeach; ?>
</div>
